getprop("ro.product.device") == "cx6670" || abort("This package is for \"cx6670\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("Target_AP: Leadcore/full_cx6670:6.0.1/xtc01261944:userdebug/test-keys");
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
ui_print("Verifying the updated system image...");
if range_sha1("/dev/block/bootdevice/by-name/system", "36,0,32766,32768,32770,32857,32859,33344,46709,65536,65538,98304,98306,98393,98395,131072,131074,163840,163842,163929,163931,196608,196610,229376,229378,229465,229467,262144,262146,294912,294914,295001,295003,327680,327682,328167,340786") == "86bd8783fdc4d38b99b71d024f448ff113c3b19b" then
if range_sha1("/dev/block/bootdevice/by-name/system", "54,32766,32768,32770,32857,32859,33344,46709,47221,65024,65536,65538,66050,97792,98304,98306,98393,98395,98907,130560,131072,131074,131586,163328,163840,163842,163929,163931,164443,196096,196608,196610,197122,228864,229376,229378,229465,229467,229979,261632,262144,262146,262658,294400,294912,294914,295001,295003,295515,327168,327680,327682,328167,340786,340787") == "6d7817c6fa662fbd2511f549308912ee08d739f9" then
ui_print("Verified the updated system image.");
else
  abort("system partition has unexpected non-zero contents after OTA update");
endif;
else
  abort("system partition has unexpected contents after OTA update");
endif;
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/bootdevice/by-name/ramdisk");
show_progress(0.200000, 10);
ui_print("Writing kernel ...");
package_extract_file("kernel", "/dev/block/bootdevice/by-name/kernel");
ui_print("Writing modemdsp0.bin ...");
package_extract_file("modemdsp0.bin", "/dev/block/bootdevice/by-name/modemdsp");
ui_print("Writing modemarm.bin ...");
package_extract_file("modemarm.bin", "/dev/block/bootdevice/by-name/modemarm");
ui_print("Writing u-boot.bin ...");
package_extract_file("u-boot.bin", "/dev/block/bootdevice/by-name/uboot");
ui_print("Writing waveform.img ...");
package_extract_file("waveform.img", "/dev/block/bootdevice/by-name/waveform");
ui_print("Writing bl31.bin ...");
package_extract_file("bl31.bin", "/dev/block/bootdevice/by-name/secure_monitor");
ui_print("Writing bl2.bin ...");
package_extract_file("bl2.bin", "/dev/block/mmcblk0boot0");
